package j05zuoye.com.lanou.raise;

public class TestRaise {
    public static void main(String[] args) {
        Person p = new Person();

        Cat cat = new Cat();
        p.raiseAnimal(cat);
        System.out.println("====");
        Animal[] aArr = new Animal[1];
        //向上转换
        aArr[0] = new Cat();
        if(aArr[0] instanceof Cat){
            //失去的东西拿回来
            Cat c = (Cat)aArr[0];
            c.catchMouse();
        }
    }
}
